﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataAccessLayer;
using MyCommon;

namespace BussinessLayer
{
    public class BaoCaoBO : BaseBO
    {

        public IEnumerable<View_PhieuTiepNhan> GetDsSuaChuaNgayInDay(DateTime inDay)
        {
            List<int> TrangThaiPhienIdList = new List<int>();
            TrangThaiPhienIdList.Add((int)MyCommon.TrangThaiPhien.ThaoTacNgay);
            TrangThaiPhienIdList.Add((int)MyCommon.TrangThaiPhien.ThaoTacNgay_HoanThanh);
            return _dao.BaoCao.GetPhieuTiepNhanByDate(TrangThaiPhienIdList, inDay, inDay);
        }

        public IEnumerable<View_PhieuTiepNhan> GetDsSuaChuaNgayInMonth(DateTime inMonth)
        {
            List<int> TrangThaiPhienIdList = new List<int>();
            TrangThaiPhienIdList.Add((int)MyCommon.TrangThaiPhien.ThaoTacNgay);
            TrangThaiPhienIdList.Add((int)MyCommon.TrangThaiPhien.ThaoTacNgay_HoanThanh);
            DateTime FristDate = new DateTime(inMonth.Year, inMonth.Month, 1);
            DateTime LastDate = FristDate.AddMonths(1).AddDays(-1);
            return _dao.BaoCao.GetPhieuTiepNhanByDate(TrangThaiPhienIdList, FristDate, LastDate);
        }

        public IEnumerable<View_PhieuTiepNhan> GetDsSuaChuaNgayBetween(DateTime inFromDate, DateTime inToDate)
        {
            List<int> TrangThaiPhienIdList = new List<int>();
            TrangThaiPhienIdList.Add((int)MyCommon.TrangThaiPhien.ThaoTacNgay);
            TrangThaiPhienIdList.Add((int)MyCommon.TrangThaiPhien.ThaoTacNgay_HoanThanh);
            return _dao.BaoCao.GetPhieuTiepNhanByDate(TrangThaiPhienIdList, inFromDate, inToDate);
        }
        
        //////////////////////////////////////////////////////////////////////////////////////////////

        public IEnumerable<View_PhieuTiepNhan> GetDsTiepNhanSuaChuaInDay(DateTime inDay)
        {
            List<int> TrangThaiPhienIdList = new List<int>();
            TrangThaiPhienIdList.Add((int)MyCommon.TrangThaiPhien.TiepNhan_DoiBaoHanh);
            TrangThaiPhienIdList.Add((int)MyCommon.TrangThaiPhien.DoiBaoHanh_HoanThanh);
            return _dao.BaoCao.GetPhieuTiepNhanByDate(TrangThaiPhienIdList, inDay, inDay);
        }

        public IEnumerable<View_PhieuTiepNhan> GetDsTiepNhanSuaChuaInMonth(DateTime inMonth)
        {
            List<int> TrangThaiPhienIdList = new List<int>();
            TrangThaiPhienIdList.Add((int)MyCommon.TrangThaiPhien.TiepNhan_DoiBaoHanh);
            TrangThaiPhienIdList.Add((int)MyCommon.TrangThaiPhien.DoiBaoHanh_HoanThanh);
            DateTime FristDate = new DateTime(inMonth.Year, inMonth.Month, 1);
            DateTime LastDate = FristDate.AddMonths(1).AddDays(-1);
            return _dao.BaoCao.GetPhieuTiepNhanByDate(TrangThaiPhienIdList, FristDate, LastDate);
        }

        public IEnumerable<View_PhieuTiepNhan> GetDsTiepNhanSuaChuaBetween(DateTime inFromDate, DateTime inToDate)
        {
            List<int> TrangThaiPhienIdList = new List<int>();
            TrangThaiPhienIdList.Add((int)MyCommon.TrangThaiPhien.TiepNhan_DoiBaoHanh);
            TrangThaiPhienIdList.Add((int)MyCommon.TrangThaiPhien.DoiBaoHanh_HoanThanh);
            return _dao.BaoCao.GetPhieuTiepNhanByDate(TrangThaiPhienIdList, inFromDate, inToDate);
        }
    }
}
